#define _CRT_SECURE_NO_WARNINGS 1
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'

int main() {
	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int n, k; cin >> n >> k;
	vector<int> a(n);
	for (int i = 0; i < n; i++) cin >> a[i];
	sort(a.begin(), a.end());
	int mx = 0;
	for (int i = 0; i < n; i++) {
		int l = i, r = n - 1;
		if (a[r] - a[l] <= k) {
			mx = max(mx, r - l + 1);
			break;
		}
		while (l < r) {
			int mid = (l + r + 1) >> 1;
			if (a[mid] - a[i] <= k) l = mid;
			else r = mid - 1;
		}
		mx = max(mx, l - i + 1);
	}
	cout << 1.0 * mx / n << endl;
	return 0;
}
